package com.sinacom.ibuilding.service;


import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Timer;

import com.ibatis.dao.client.DaoManager;
import com.sinacom.ibuilding.dao.DaoConfig;
import com.sinacom.ibuilding.dao.iface.DualDao;
import com.sinacom.ibuilding.util.DualTask;

public class DualService {
	
	private DualDao dualDao;
	public DualService(){
		DaoManager	daoManager = DaoConfig.getDaoManager();
		dualDao = (DualDao) daoManager.getDao(DualDao.class);
	}
	
	public int getDual(){
		Map map = new HashMap();
		return dualDao.getDual(map);
	}
	
	
	
	public static void main(String[] args) throws IOException{
	//	DualService dualService = new DualService();
	//	System.out.println(dualService.getDual());
		 Timer timer = new Timer();
         timer.schedule(new DualTask(), 1000, 60000);//在1秒后执行此任务,以后每隔1秒执行这个MyTask任务.
	}

}
